home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / Rapidshare2140831182009.psc / 5 VB 6 Rapidshare Downloaders And Inet Fixer By Delboy / Rapidshare Premium Downloader 1.0 (inet) (Working Fine) / form1.frm next >
Text File  |  2009-01-18  |  8KB  |  294 lines

  1. VERSION 5.00
  2. Object = "{48E59290-9880-11CF-9754-00AA00C00908}#1.0#0"; "MSINET.OCX"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  4. Begin VB.Form frm2mainbuiltin 
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "Rapidshare Downloader 1.0 - Built In Account Mode By Delboy {F4U}"
  7.    ClientHeight    =   7095
  8.    ClientLeft      =   45
  9.    ClientTop       =   330
  10.    ClientWidth     =   9225
  11.    Icon            =   "form1.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   7095
  15.    ScaleWidth      =   9225
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin VB.DriveListBox Drive1 
  18.       Height          =   315
  19.       Left            =   3600
  20.       TabIndex        =   17
  21.       Top             =   3960
  22.       Width           =   3855
  23.    End
  24.    Begin VB.DirListBox Dir1 
  25.       Height          =   1665
  26.       Left            =   240
  27.       TabIndex        =   16
  28.       Top             =   4320
  29.       Width           =   8895
  30.    End
  31.    Begin VB.PictureBox Picture1 
  32.       Height          =   3255
  33.       Left            =   120
  34.       Picture         =   "form1.frx":0CCA
  35.       ScaleHeight     =   3195
  36.       ScaleWidth      =   8955
  37.       TabIndex        =   15
  38.       Top             =   120
  39.       Width           =   9015
  40.    End
  41.    Begin VB.TextBox txtFileName 
  42.       Height          =   285
  43.       Left            =   1080
  44.       TabIndex        =   10
  45.       Text            =   "File Name E.g Hello.rar"
  46.       Top             =   3960
  47.       Width           =   2415
  48.    End
  49.    Begin VB.TextBox txtdownloader 
  50.       Height          =   375
  51.       Left            =   1440
  52.       TabIndex        =   9
  53.       Text            =   "Download Link"
  54.       Top             =   3480
  55.       Width           =   6015
  56.    End
  57.    Begin VB.CommandButton cmdrotate 
  58.       Caption         =   "Rotate Account"
  59.       Height          =   255
  60.       Left            =   7560
  61.       TabIndex        =   8
  62.       Top             =   3960
  63.       Width           =   1575
  64.    End
  65.    Begin VB.ListBox User 
  66.       Height          =   1230
  67.       Left            =   240
  68.       TabIndex        =   7
  69.       Top             =   7200
  70.       Width           =   1695
  71.    End
  72.    Begin VB.ListBox Pass 
  73.       Height          =   1230
  74.       Left            =   1920
  75.       TabIndex        =   6
  76.       Top             =   7200
  77.       Width           =   1695
  78.    End
  79.    Begin VB.TextBox txtpass 
  80.       Height          =   405
  81.       Left            =   3720
  82.       TabIndex        =   5
  83.       Text            =   "txtpass"
  84.       Top             =   7560
  85.       Width           =   2415
  86.    End
  87.    Begin VB.CommandButton cmdaccounts 
  88.       Caption         =   "cmdaccounts"
  89.       Height          =   255
  90.       Left            =   3720
  91.       TabIndex        =   4
  92.       Top             =   7920
  93.       Width           =   2415
  94.    End
  95.    Begin VB.TextBox txtuser 
  96.       Height          =   375
  97.       Left            =   3720
  98.       TabIndex        =   3
  99.       Text            =   "txtuser"
  100.       Top             =   7200
  101.       Width           =   2415
  102.    End
  103.    Begin VB.CommandButton cmdlogin 
  104.       Caption         =   "cmdlogin"
  105.       Height          =   255
  106.       Left            =   3720
  107.       TabIndex        =   2
  108.       Top             =   8160
  109.       Width           =   2415
  110.    End
  111.    Begin MSComctlLib.ProgressBar ProgressBar1 
  112.       Height          =   375
  113.       Left            =   240
  114.       TabIndex        =   1
  115.       Top             =   6120
  116.       Width           =   8895
  117.       _ExtentX        =   15690
  118.       _ExtentY        =   661
  119.       _Version        =   393216
  120.       Appearance      =   1
  121.    End
  122.    Begin InetCtlsObjects.Inet Inet1 
  123.       Left            =   6480
  124.       Top             =   7800
  125.       _ExtentX        =   1005
  126.       _ExtentY        =   1005
  127.       _Version        =   393216
  128.    End
  129.    Begin VB.CommandButton cmdDownload 
  130.       Caption         =   "Download"
  131.       Height          =   375
  132.       Left            =   7560
  133.       TabIndex        =   0
  134.       Top             =   3480
  135.       Width           =   1575
  136.    End
  137.    Begin VB.Label Label4 
  138.       Alignment       =   2  'Center
  139.       Caption         =   "www.freesoftwarealliance.com"
  140.       ForeColor       =   &H00FF0000&
  141.       Height          =   375
  142.       Left            =   120
  143.       TabIndex        =   14
  144.       Top             =   6840
  145.       Width           =   8895
  146.    End
  147.    Begin VB.Label Label3 
  148.       Alignment       =   2  'Center
  149.       Caption         =   "Created By Delboy With Help From lintz"
  150.       ForeColor       =   &H000000FF&
  151.       Height          =   255
  152.       Left            =   240
  153.       TabIndex        =   13
  154.       Top             =   6600
  155.       Width           =   8895
  156.    End
  157.    Begin VB.Label Label2 
  158.       Caption         =   "File Name:"
  159.       Height          =   255
  160.       Left            =   240
  161.       TabIndex        =   12
  162.       Top             =   3960
  163.       Width           =   1335
  164.    End
  165.    Begin VB.Label Label1 
  166.       Caption         =   "Download Link:"
  167.       Height          =   255
  168.       Left            =   240
  169.       TabIndex        =   11
  170.       Top             =   3480
  171.       Width           =   1335
  172.    End
  173. End
  174. Attribute VB_Name = "frm2mainbuiltin"
  175. Attribute VB_GlobalNameSpace = False
  176. Attribute VB_Creatable = False
  177. Attribute VB_PredeclaredId = True
  178. Attribute VB_Exposed = False
  179. Option Explicit
  180. Private Sub Form_Load()
  181. Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
  182. ProgressBar1.Visible = False
  183. cmdDownload.Enabled = False
  184. Call cmdaccounts_Click
  185. Call cmdrotate_Click
  186. Call cmdlogin_Click
  187. End Sub
  188. Private Sub cmdrotate_Click()
  189. If User.ListIndex = User.ListCount - 1 Then
  190.     User.ListIndex = 0 - 1
  191. End If
  192. User.ListIndex = User.ListIndex + 1
  193. txtuser.Text = User.List(User.ListIndex)
  194.  
  195. If Pass.ListIndex = Pass.ListCount - 1 Then
  196.     Pass.ListIndex = 0 - 1
  197. End If
  198. Pass.ListIndex = Pass.ListIndex + 1
  199. txtpass.Text = Pass.List(Pass.ListIndex)
  200. Call cmdlogin_Click
  201. End Sub
  202.  
  203. Private Sub cmdaccounts_Click()
  204. ' http://rapidshare.com/cgi-bin/premium.cgi?accountid=AccountID&password=PassWord&premiumlogin=1
  205. User.AddItem "ACCOUNT1"
  206. Pass.AddItem "PASS1"
  207. User.AddItem "ACCOUNT2"
  208. Pass.AddItem "PASS2"
  209. User.AddItem "ACCOUNT3"
  210. Pass.AddItem "PASS3"
  211. End Sub
  212.  
  213.  
  214. Private Sub cmdDownload_Click()
  215. Screen.MousePointer = vbHourglass
  216.  
  217. ProgressBar1.Value = 0
  218.  
  219. ProgressBar1.Visible = True 'show progressbar
  220.  
  221. 'This downloads the file and saves to your machine
  222. DownloadFile txtdownloader.Text, Dir1.Path & "\" & txtFileName.Text
  223.  
  224. Screen.MousePointer = vbDefault
  225. MsgBox "Download Complete"
  226.  
  227. ProgressBar1.Visible = False
  228.  
  229. End Sub
  230.  
  231. Private Sub cmdlogin_Click()
  232. Inet1.OpenURL ("http://rapidshare.com/cgi-bin/premium.cgi?accountid=" & txtuser.Text & "&password=" & txtpass.Text & "&premiumlogin=1")
  233. cmdDownload.Enabled = True
  234. End Sub
  235.  
  236. Sub DownloadProgress(intPercent As String)
  237.     ProgressBar1.Value = intPercent ' Update file download progress
  238. End Sub
  239.  
  240.  
  241. 'Public Function DownloadFile(strURL As String, strDestination As String) As Boolean
  242. Public Sub DownloadFile(strURL As String, strDestination As String) 'As Boolean
  243. Const CHUNK_SIZE As Long = 1024
  244. Dim intFile As Integer
  245. Dim lngBytesReceived As Long
  246. Dim lngFileLength As Long
  247. Dim strHeader As String
  248. Dim b() As Byte
  249. Dim i As Integer
  250.  
  251. DoEvents
  252.     
  253. With Inet1
  254.     
  255. .URL = strURL
  256. .Execute , "GET", , "Range: bytes=" & CStr(lngBytesReceived) & "-" & vbCrLf
  257.         
  258. While .StillExecuting
  259. DoEvents
  260. Wend
  261.  
  262. strHeader = .GetHeader
  263. End With
  264.     
  265.     
  266. strHeader = Inet1.GetHeader("Content-Length")
  267. lngFileLength = Val(strHeader)
  268.  
  269. DoEvents
  270.     
  271. lngBytesReceived = 0
  272.  
  273. intFile = FreeFile()
  274.  
  275. Open strDestination For Binary Access Write As #intFile
  276.  
  277. Do
  278. b = Inet1.GetChunk(CHUNK_SIZE, icByteArray)
  279. Put #intFile, , b
  280. lngBytesReceived = lngBytesReceived + UBound(b, 1) + 1
  281.  
  282. DownloadProgress (Round((lngBytesReceived / lngFileLength) * 100))
  283. DoEvents
  284. Loop While UBound(b, 1) > 0
  285.  
  286. Close #intFile
  287.  
  288. End Sub
  289.  
  290.  
  291. Private Sub Drive1_Change()
  292. Dir1.Path = Drive1.Drive
  293. End Sub
  294.